package com.zjitc.config;

import com.zjitc.obj.Teacher;
import com.zjitc.obj.User;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.Scope;

/**
 * Created by 沈银 on 2018/3/7.
 */
//多个配置文件的引用
@Configuration
@Import(JavaConfigDemo1.class)
public class JavaConfigDemo2 {
    @Bean
    @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
    public Teacher teacher(User user){
        return new Teacher(user);
    }
}
